package leetcode.interview1714;

import java.util.Arrays;

public class Solution1 extends Interview1714 {

	@Override
	public int[] smallestK(int[] arr, int k) {
		if (k == 0)
			return new int[] {};
		if (arr == null || arr.length == 0 || arr.length < k)
			return arr;
		Arrays.sort(arr);
		int[] result = new int[k];
		for (int i = 0; i < k; i++) {
			result[i] = arr[i];
		}
		return result;
	}

	public static void main(String[] args) {
		Solution1 so = new Solution1();
		so.debug1();
	}

}
